Release 10.1A: OpenEdge Development:
Progress Dynamics Advanced Development
Properties typically used in action rules
You can use any property or function you want in an action rule, but there are a handful that are most likely to be useful. These are all used in existing action rules in the
Navigation,TableIO, andCommitcategories. Here are some useful properties:
QueryPosition— This SDO property identifies where in the dataset the cursor is positioned. It is generally used to identify which navigation items to enable. Its possible values are:RowObjectState— This SDO property identifies whether a modified record has been saved on the client without being returned to the server. This would normally be true only if there is aCommit-Source(such as toolbar with a band of Commit and Undo buttons) in the window that causes updates to be cached on the client until aCommitevent happens. So the Commit and Undo buttons use these two values to determine whether they should be enabled or not:RecordState— This property, defined for data visualization SmartObjects, indicates whether there is a record available to display or update. Its possible values are:
RecordAvailable— There is a record available for display or update.NoRecordAvailable— There is no record available for display or update. This normally means that the dataset of the associated SDO is empty. This could be the case, for example, when the user is addingOrderLinerecords for anOrderand the firstOrderLinehas not yet been added. In this state, the application can allow an Add operation but not an Update or Delete.NoRecordAvailableExt— This special value indicates that not only is there no record available in the current dataset, but there is no record available in the parent dataset either (Theextsuffix means extended). This is useful information because it signals to an update band that it is not appropriate to enable even an Add operation. For example, if the current SDO is anOrderLineSDO, and is a child of anOrderSDO, and there is no currently selectedOrder(perhaps because the currentCustomerin the SDO yet another level above has no orders), then it is not appropriate to allow the user to add anOrderLinebecause there is noOrderkey to assign to it. This is why the action rule for the Add button is this:
At first it might not seem sensible to check that the
RecordStateis eitherRecordAvailableorNoRecordAvailable, but it is for exactly this reason that this is the case. The one remaining condition is that theRecordStateisNoRecordAvailableExt, and in this case the Add button is not enabled.Editable— ThisLOGICALproperty is defined for data visualization SmartObjects, and it isTRUEif the current target SmartObject is editable, that is, can be used for anAdd,Copy,Update, orDelete. This is normally the case if the object has any enabled fields, or if it is aGroupAssign-Sourcefor some other object that has enabled fields.DataModified— ThisLOGICALproperty is defined for SDOs, and it isTRUEif the current record in the dataset has been modified but not saved. As soon as a user begins to type into an enabled field in a viewer or an enabled cell in a browser, a trigger sets this property toTRUEand notifies the toolbar that is itsTableIO-Source. The result is that the Save and Cancel buttons are immediately enabled.NewRecord— This property is defined for data visualization SmartObjects. It indicates whether the currently displayed record is a newly created record, that is, one that has not yet been saved back to the database. It is aCHARACTERproperty rather than aLOGICALproperty because it can have three possible values:ObjectMode— This data visualization property is new to the ADM2 with Progress Dynamics. It is used by some of the toolbar types that contain View and Modify buttons that alternate the enabled state of the object, as well as a Save button to actually save changes. Its three possible values are:FilterActive— ThisLOGICALproperty isTRUEif there is currently a filter applied to the SDO that is being browsed. This is used, for example, in the alternate image rule for the Filter button itself, to display the image with the check mark. You might also use it to determine whether all data for a table is being retrieved or only a filtered subset of the data.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |